package davey.wu.hamcrest.expected;

import org.mockito.internal.matchers.GreaterOrEqual;
import org.mockito.internal.matchers.GreaterThan;
import org.mockito.internal.matchers.LessOrEqual;
import org.mockito.internal.matchers.LessThan;
import davey.wu.hamcrest.expected.interdef.NumberExpectedOp;

public abstract class NumberExpected<T extends Number & Comparable<T>, E extends NumberExpectedOp<T, E>> extends
		BaseImplExpected<T, E> implements NumberExpectedOp<T, E> {

	@SuppressWarnings("unchecked")
	public NumberExpected(Class<T> clazT, Class<? extends NumberExpectedOp> clazE) {
		super(clazT, clazE);
	}

	public E lt(int max) {
		LessThan<Integer> matcher = new LessThan<Integer>(max);
		return this.link(matcher);
	}

	public E leq(int max) {
		LessOrEqual<Integer> matcher = new LessOrEqual<Integer>(max);
		return this.link(matcher);
	}

	public E gt(int min) {
		GreaterThan<Integer> matcher = new GreaterThan<Integer>(min);
		return this.link(matcher);
	}

	public E geq(int min) {
		GreaterOrEqual<Integer> matcher = new GreaterOrEqual<Integer>(min);
		return this.link(matcher);
	}
}
